package com.tyk.bookstore.front.member.model.query;

import com.tyk.bookstore.front.common.core.model.constant.ValidateConstant;
import com.tyk.bookstore.front.member.constant.MemberValidConstant;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;


@Data
public class MemberRegisterQuery {

    @Schema(description = "主体[手机号](needed since v2)")
//    @NotBlank
    @Size(min = ValidateConstant.PHONE_MIN_LENGTH, max = ValidateConstant.PHONE_MAX_LENGTH)
    @Pattern(regexp = ValidateConstant.PHONE_REGEXP)
    private String principal;

    @Schema(description = "用户名")
    @NotBlank
    @Size(min = MemberValidConstant.NICKNAME_MIN_LENGTH, max = MemberValidConstant.NICKNAME_MAX_LENGTH)
    @Pattern(regexp = MemberValidConstant.NICKNAME_REGEXP)
    private String nickname;

    @Schema(description = "密码")
    @NotBlank
    @Size(min = ValidateConstant.PASSWORD_MIN_LENGTH, max = ValidateConstant.PASSWORD_MAX_LENGTH)
    @Pattern(regexp = ValidateConstant.PASSWORD_REGEXP)
    private String password;

    @Schema(description = "消息验证码校验通过凭证")
    @NotBlank
    private String verifyCode;
}
